"use strict";
const common_vendor = require("../../../../../../../common/vendor.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "index",
  setup(__props) {
    const diseaseschart1 = common_vendor.ref(null);
    const diseasestype = common_vendor.ref({
      categories: ["疾病诱发风险性", "身体情况"]
      // 修正拼写错误
    });
    common_vendor.onMounted(() => {
      if (diseaseschart1.value) {
        const myChart = common_vendor.init(diseaseschart1.value);
        window.addEventListener("resize", () => {
          myChart.resize();
        });
        const option = {
          tooltip: {
            show: false
          },
          grid: {
            top: "20%",
            left: "20%",
            right: "20%",
            bottom: "20%"
          },
          xAxis: {
            type: "value",
            show: false
          },
          yAxis: {
            type: "category",
            // 将 yAxis 类型修改为 'category'
            data: diseasestype.value.categories,
            axisLabel: {
              formatter(value) {
                return `${value}`;
              }
            },
            axisLine: {
              show: false
            },
            axisTick: {
              show: false
            }
          },
          series: [
            {
              name: "正常",
              type: "bar",
              stack: "total",
              label: {
                show: true,
                position: "right",
                formatter: "正常"
              },
              data: [
                {
                  value: 1,
                  itemStyle: {
                    color: "red"
                  }
                },
                {
                  value: 1,
                  itemStyle: {
                    color: "red"
                  }
                }
              ],
              barWidth: 20
            },
            {
              name: "中度",
              type: "bar",
              stack: "total",
              data: [
                {
                  value: 1,
                  itemStyle: {
                    color: "orange"
                  }
                },
                {
                  value: 1,
                  itemStyle: {
                    color: "orange"
                  }
                }
              ],
              barWidth: 20
            },
            {
              name: "轻度",
              type: "bar",
              stack: "total",
              data: [
                {
                  value: 1,
                  itemStyle: {
                    color: "blue"
                  }
                },
                {
                  value: 1,
                  itemStyle: {
                    color: "blue"
                  }
                }
              ],
              barWidth: 20
            },
            {
              name: "正常",
              type: "bar",
              stack: "total",
              data: [
                {
                  value: 1,
                  itemStyle: {
                    color: "green"
                  }
                },
                {
                  value: 1,
                  itemStyle: {
                    color: "green"
                  }
                }
              ],
              barWidth: 20
            },
            {
              name: "正常",
              type: "bar",
              stack: "total",
              data: [
                {
                  value: 1,
                  itemStyle: {
                    color: "yellow"
                  }
                },
                {
                  value: 1,
                  itemStyle: {
                    color: "yellow"
                  }
                }
              ],
              barWidth: 20
            }
          ]
        };
        myChart.setOption(option);
      }
    });
    return (_ctx, _cache) => {
      return {};
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-78c875d1"]]);
wx.createComponent(Component);
